import time
def importf(name):
    file=open(name, 'r')
    data=file.readlines()
    return data
def sort(mass):
    a=True
    while(a):
        a=False
        for i in range(len(mass)-1):
            if mass[i]>mass[i+1]:
                mass[i], mass[i+1]=mass[i+1], mass[i]
                a=True
            
A=importf("m1_sorted.txt")
t_start=time.time()
sort(A)
t_stop=time.time()
print("m1_sorted", round((t_stop-t_start)*1000), "milliseconds")

A=importf("m2_reverse.txt")
t_start=time.time()
sort(A)
t_stop=time.time()
print("m2_reverse", round((t_stop-t_start)*1000), "milliseconds")

A=importf("m3_shuffle.txt")
t_start=time.time()
sort(A)
t_stop=time.time()
print("m3_shuffle", round((t_stop-t_start)*1000), "milliseconds")
